<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="author" content="" />
<link rel="stylesheet" href="../css/main.css" type="text/css" />
<link href="../css/themes/default.css" rel="stylesheet" type="text/css"/>
<link href="../css/themes/mac_os_x.css" rel="stylesheet" type="text/css"/>
<link href="../css/themes/alphacube.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../js/prototype.js"></script>
<script type="text/javascript" src="../js/scriptaculous.js"></script>
<script type="text/javascript" src="../js/controls.js"></script>
<script type="text/javascript" src="../js/page.js"></script>
<script type="text/javascript" src="../js/window.js"></script>
<script type="text/javascript">
var win; 
var msg;
function gruppo(gr){
	document.location.href = "new_pwd.php?gruppo="+gr;
}

function new_pwd(gruppo, uid, utente){
	//win = window.open_centered("give_pwd.php?gruppo="+gruppo+"&uid="+uid+"&ut="+utente, "pass", 400, 220, "");
	win = new Window({className: "mac_os_x", url: "give_pwd.php?gruppo="+gruppo+"&uid="+uid+"&ut="+utente,  width:400, height:220, zIndex: 100, resizable: true, title: "Dettaglio news", showEffect:Effect.Appear, hideEffect: Effect.Fade, draggable:true, wiredDrag: true});
	win.showCenter(false);
}

var timeout; 
function openInfoDialog() {
	var html = "<div style='width: 100%, text-align: center; font-size: 12px; font-weight: bold; padding-top: 30px; margin: auto'>"+msg+"</div>";
	Dialog.info(html, 
	{
		width:250, 
		height:100, 
		showProgress: false,
		className: "alphacube"
	}); 
	timeout = 2; 
	setTimeout(infoTimeout, 1000);
} 
function infoTimeout() { 
	timeout--; 
	if (timeout > 0) { 
		//Dialog.setInfoMessage(messages[index]); 
		setTimeout(infoTimeout, 1000); 
	} 
	else 
		Dialog.closeInfo();
}
</script>
<style>
tbody td:hover {background-color: #e8f2fe }
</style>
<title>Modifica password</title>
</head>
<body>
    <div id="header">
		<div class="wrap">
			<?php include "header.php" ?>
		</div>
	</div>
	<div class="wrap">
	<div id="main" style="background-color: #FFFFFF; padding-bottom: 30px; width: 100%">
    <form>
        <table class="admin_table">
        <thead>
            <tr class="admin_title_row">
                <td style="" colspan="5">Modifica password utente</td>
            </tr>
            <tr class="admin_row">
                <td colspan="5" style="text-align: center">
                	<a href="#" onclick="gruppo(1)" style="">Personale della scuola</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
                	<a href="#" onclick="gruppo(2)" style="">Studenti</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
                	<a href="#" onclick="gruppo(3)" style="">Genitori</a>
                </td>
            </tr>
            <tr class="admin_row">
                <td colspan="5"></td>
            </tr>
            <?php 
            if($gruppo == 2){
            ?>
            <tr class="admin_row">
                <td colspan="5" style="padding-bottom: 2px; padding-top: 2px; text-align: center; border-top: 1px solid gray; border-bottom: 1px solid gray; background-color: #E7E7E7">
                <?php
		        for($i = 0; $i < count($alfabeto); $i++){
		        	if($_REQUEST['start'] == $alfabeto[$i]){  		
		        ?>
		        	<span>[&nbsp;<?php print $alfabeto[$i] ?>&nbsp;]</span>
		        <?php
		        	}
		        	else{
		        ?>
		            <a style="text-decoration: none" href="new_pwd.php?gruppo=<?php print $gruppo?>&start=<?php print $alfabeto[$i] ?>">&nbsp;&nbsp;<?php print $alfabeto[$i] ?>&nbsp;&nbsp;</a>
		        <?php
		        	}
		        }
		        ?>
		        	<a style="text-decoration: none" href="#" onclick="gruppo(<?php print $gruppo?>)">&nbsp;&nbsp;Tutti&nbsp;&nbsp;</a>
                </td>
            </tr>
            <tr>
                <td colspan="5">&nbsp;&nbsp;&nbsp;</td>
            </tr>
            <?php 
            }
            ?>
            </thead>
            <tbody>
            <tr class="admin_row">
            <?php 
            $x = 1;
            while($utente = $res_utenti->fetch_assoc()){
            ?>
                <td style="width: 20%; "><a href="#" onclick="new_pwd(<?php print $gruppo ?>, <?php  print $utente[$id] ?>, '<?php print $utente['cognome']." ".$utente['nome'] ?>')" title="<?php  print $utente[$id] ?>" style="text-decoration: none;"><?php print $utente['cognome']." ".$utente['nome'] ?></a></td>
            <?php 
            	if($x%5 == 0){
            		print("</tr>\n\t<tr class='admin_row'>\n");
            	}
            	$x++;
            }
            ?>
            </tr>
            </tbody>
            <tfoot>
            <tr class="admin_row">
                <td colspan="5"></td>
            </tr>
            <tr class="admin_row admin_menu">
                <td colspan="5" style="text-align: right; padding-right: 30px">
                    <a href="<?php print $_SESSION['__config__']['html_root'] ?>admin/index.php">Torna Menu</a>
                </td>
            </tr>
            <tr>
                <td colspan="5">&nbsp;&nbsp;&nbsp;</td>
            </tr>
            </tfoot>
        </table>
    </form>
    </div>	
	<div id="footer">
		<p>Design: Luka Cvrk - <a href="http://www.solucija.com" title="Free Web Templates">Solucija</a></p>
	</div>
	</div>		
</body>
</html>